﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Framework;
using Infrastructure.DataObjects;

namespace Domain.Module.Entities
{
    public partial class Comment : IAggregateRoot
	{
        public static Comment Create(CommentObject commentObject, CommentType? type = new CommentType?())
        {
            Comment comment = new Comment
            {
                ID = commentObject.ID,
                Body = commentObject.Body,
                Title = commentObject.Title,
                CreateTime = commentObject.CreateTime,
                Type = type.HasValue ? type.Value.ToString() : commentObject.Type
            };
            return comment;
        }
	}
}
